package xyz.renyumeng.xkm.redis;

/**
 * @author renyumeng
 * @date Created in 20:20 2023/1/14
 */
public interface ILock {

    /**
     * 尝试获取锁
     *
     * @param timeoutSec 锁持有时间，过期自动释放
     * @return true代表获取锁成功
     */
    boolean tryLock(long timeoutSec);


    /**
     * 释放锁
     */
    void unlock();
}
